import { OrgRecord } from '@/api/system/model/orgModel';
import { DeptRecord } from '@/api/system/model/deptModel';

export type RoleType = '' | '*' | 'admin' | 'user';

export interface UserState extends UserInfoState {
  permissions?: string[];
  roles?: string[];
  menus?: MenuState[];
}

export interface UserInfoState {
  id?: string;
  username?: string;
  avatar?: string;
  polity?: string;
  deptId?: string;
  address?: string;
  email?: string;
  nickname?: string;
  deptCode?: string;
  mobile?: string;
  userCode?: string;
  title?: string;
  role: RoleType;
  secretLevel?: number;
  mainOrgId?: number;
  mainDept?: DeptRecord;
  currentOrgId?: number;
  currentDeptId?: number;
  orgInfoList: OrgRecord[];
}

export interface MenuState {
  component?: string;
  type?: number;
  icon?: string;
  name: string;
  children?: MenuState[];
  permission?: string;
  code?: string;
  path?: string;
}
